'use strict';

const BaseService = require('./base');

class SectionService extends BaseService {
  constructor(...props) {
    super('Section', ...props)
  }
  
  //获取sections
  async getSectionsByBookletId(booklet_id) {
    const { primary_model, ctx } = this;
    return await primary_model.findAll({
      where: { booklet_id, status: '1' },
      attributes: ['id', 'serial_number', 'name'],
      order: [['serial_number', 'ASC']],
    })
  }
}

module.exports = SectionService;
